<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>采购模板</title>
    <link rel="stylesheet" href="/layui/css/layui.css"  media="all">
    <script type="text/javascript" src="/layui/jquery-3.5.1.min.js"></script>
    <script src="/layui/layui.js" charset="utf-8"></script>
    <script th:inline="javascript">
        layui.use('layer', function(){
            var $ = layui.jquery;
            $("body").on("click","#download",function () {
                window.open("/purchase/downloadContentFile?filename="+[[${procurementTemplate.content}]])
            })
            $("body").on("click",".riskAssessmentResult",function () {
                window.open("/purchase/downloadRiskAssessmentFile?filename="+[[${procurementTemplate.riskAssessment}]])
            })
        })

    </script>
</head>
<body>
<div style="margin: auto; width: 900px"><br><br>
    <fieldset class="layui-elem-field"  style="margin-top: 20px; padding: 20px">
        <legend>采购模板</legend>
        <form class="layui-form layui-form-pane" action="">
            <div class="layui-form-item">
                <label class="layui-form-label">模板名称:</label>
                <div class="layui-input-block">
                    <input th:value="${procurementTemplate.name}" readonly="readonly" type="text"  lay-verify="title" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">申请人</label>
                    <div class="layui-input-inline">
                        <input lay-verify="required" type="text" readonly="readonly" autocomplete="off" class="layui-input" th:value="${procurementTemplate.staff.name}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">采购产品:</label>
                <div class="layui-input-inline">
                    <input lay-verify="required" type="text" readonly="readonly" autocomplete="off" class="layui-input" th:value="${procurementTemplate.product.dictionaryA.value}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">内容文件</label>
                <div class="layui-upload">
                    <button type="button" class="layui-btn layui-btn-normal" id="download">下载文件</button>
                    <span style="color:gray;" th:text="${procurementTemplate.content}"/>
                </div>
            </div>
            <div class="layui-form-item layui-form-text">
                <label class="layui-form-label">采购备注</label>
                <div class="layui-input-block">
                    <textarea th:text="${procurementTemplate.remark}" class="layui-textarea" id="remark"></textarea>
                </div>
            </div>

        </form>
    </fieldset>
    <fieldset class="layui-elem-field"  style="margin-top: 20px; padding: 20px">
        <legend>审批结果</legend>
        <br>
        <ul th:each="data:${procurementTemplate.enable}"  class="layui-timeline">
            <li th:if="${data == 0}" class="layui-timeline-item">
                <i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop layui-timeline-axis"></i>
                <div class="layui-timeline-content layui-text">
                    <div class="layui-timeline-title">驳回审批</div>
                    <button type="button" class="layui-btn layui-btn-normal riskAssessmentResult">风险评估记录</button>
                    <span style="color:gray;" th:text="${procurementTemplate.riskAssessment}"/>
                </div>
            </li>
            <li th:if="${data == 1}" class="layui-timeline-item">
                <i class="layui-icon layui-timeline-axis"></i>
                <div class="layui-timeline-content layui-text">
                    <div class="layui-timeline-title">审核中</div>
                </div>
            </li>
            <li th:if="${data == 2}" class="layui-timeline-item">
                <i class="layui-icon layui-anim layui-anim-rotate layui-anim-loop layui-timeline-axis"></i>
                <div class="layui-timeline-content layui-text">
                    <div class="layui-timeline-title">审批通过</div>
                    <button type="button" class="layui-btn layui-btn-normal riskAssessmentResult">风险评估记录</button>
                    <span style="color:gray;" th:text="${procurementTemplate.riskAssessment}"/>
                </div>
            </li>
        </ul>
    </fieldset>
</div>
</body>
</html>
